home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d26 / stages12.arc / MENUS1.C < prev    next >
Text File  |  1991-05-22  |  18KB  |  595 lines

  1. #include "header.h"
  2. #include "file.h"
  3.  
  4. #if PC
  5. #define TAB1    4    /* pos of 1st col of menu items on pc screen */
  6. #define TAB2    35    /* pos of 2nd col of menu items on pc screen */
  7. #endif
  8.  
  9. /*************************************************************************/
  10. /**    menu functions                                   **/
  11. /*************************************************************************/
  12. /* all menus return int value:
  13.     0 = successful input, continue program
  14.  
  15.    menus listed herein:
  16.         generalmenu
  17.         helpmenu
  18.         animalmenu
  19. */
  20. /********************************/
  21. /*     function: generalmenu    */
  22. /********************************/
  23. /* prints out the general menu */
  24. generalmenu (opfil)
  25.   char *opfil;        /* might be set in file options screen */
  26. {
  27.   char input[MAXLEN];    /* user menu choice */
  28.   char c;
  29. #if PC
  30.   int val;        /* return val of getusrstr */
  31.   int i;
  32. #endif
  33.  
  34.   while (TRUE) {
  35.   /* endless loop; have to exit via one of the returns in the loop */
  36. #if PC
  37.     topline(" General Menu ");
  38.     clrscr1(1);
  39.     normvideo();
  40.     i = 2;
  41.     gotoxy(TAB2, i++);
  42.     cprintf("H:  Stages Program Overview");
  43.     gotoxy(TAB2, i++);
  44.     cprintf("I:  Input Syntax Description");
  45.     gotoxy(TAB2, i++);
  46.     cprintf("J:  Output Table Explanation");
  47.     gotoxy(TAB2, i++);
  48.     cprintf("K:  Printer and File Options");
  49.     i = 2;
  50.     gotoxy(TAB1, i++);
  51.     cprintf("A:  (...");
  52.     highvideo();
  53.     cprintf("General Menu");
  54.     normvideo();
  55.     cprintf("...)");
  56.     gotoxy(TAB1, i++);
  57.     cprintf("B:  Go to Help Menu");
  58.     gotoxy(TAB1, i++);
  59.     cprintf("C:  Go to Animal Menu");
  60.     gotoxy(TAB1, i++);
  61.     cprintf("D:  Go to Cycle Length Menu");
  62.     gotoxy(TAB1, i++);
  63.     cprintf("E:  Go to Display Menu");
  64.     gotoxy(TAB1, i++);
  65.     cprintf("F:  Go to Cell Input Menu");
  66.     gotoxy(TAB1, i++);
  67.     cprintf("G:  Go to Days Input Menu");
  68.     i++;
  69.     gotoxy(TAB1, i++);
  70.     cprintf("X:  Exit Program");
  71.     if (HARDCOPY) {
  72.       togglepr();
  73.       fprintf(stdprn, "\n\n\t\t    General Menu\n\n");
  74.       fprintf(stdprn, "\tA:  (...General Menu...)\n");
  75.       fprintf(stdprn, "\tB:  Go to Help Menu\n");
  76.       fprintf(stdprn, "\tC:  Go to Animal Menu\n");
  77.       fprintf(stdprn, "\tD:  Go to Cycle Length Menu\n");
  78.       fprintf(stdprn, "\tE:  Go to Display Menu\n");
  79.       fprintf(stdprn, "\tF:  Go to Cell Input Menu\n");
  80.       fprintf(stdprn, "\tG:  Go to Days Input Menu\n\n");
  81.       fprintf(stdprn, "\tH:  Stages Program Overview\n");
  82.       fprintf(stdprn, "\tI:  Input Syntax Description\n");
  83.       fprintf(stdprn, "\tJ:  Output Table Explanation\n");
  84.       fprintf(stdprn, "\tK:  Printer and File Options\n\n");
  85.       fprintf(stdprn, "\tX:  Exit Program\n");
  86.     }
  87. #else
  88.     printf("\n\n\t\t    General Menu\n\n");
  89.     printf("\tA:  (...General Menu...)\n");
  90.     printf("\tB:  Go to Help Menu\n");
  91.     printf("\tC:  Go to Animal Menu\n");
  92.     printf("\tD:  Go to Cycle Length Menu\n");
  93.     printf("\tE:  Go to Display Menu\n");
  94.     printf("\tF:  Go to Cell Input Menu\n");
  95.     printf("\tG:  Go to Days Input Menu\n\n");
  96.     printf("\tH:  Stages Program Overview\n");
  97.     printf("\tI:  Input Syntax Description\n");
  98.     printf("\tJ:  Output Table Explanation\n");
  99.     printf("\tK:  Printer and File Options\n\n");
  100.     printf("\tX:  Exit Program\n");
  101. #endif
  102.     if (FILEq && FILECOPY) {
  103.       fprintf(fpout, "\n\n\t\t    General Menu\n\n");
  104.       fprintf(fpout, "\tA:  (...General Menu...)\n");
  105.       fprintf(fpout, "\tB:  Go to Help Menu\n");
  106.       fprintf(fpout, "\tC:  Go to Animal Menu\n");
  107.       fprintf(fpout, "\tD:  Go to Cycle Length Menu\n");
  108.       fprintf(fpout, "\tE:  Go to Display Menu\n");
  109.       fprintf(fpout, "\tF:  Go to Cell Input Menu\n");
  110.       fprintf(fpout, "\tG:  Go to Days Input Menu\n\n");
  111.       fprintf(fpout, "\tH:  Stages Program Overview\n");
  112.       fprintf(fpout, "\tI:  Input Syntax Description\n");
  113.       fprintf(fpout, "\tJ:  Output Table Explanation\n");
  114.       fprintf(fpout, "\tK:  Printer and File Options\n\n");
  115.       fprintf(fpout, "\tX:  Exit Program\n");
  116.     }
  117.  
  118.  
  119. #if PC
  120.     clrscr1(2);
  121.     cprintf("%sPlease enter your menu choice:", tab);
  122.     gotoxy(1, 2);
  123.     highvideo();
  124.     cprintf("%s%c%c%c ", tab2, HBAR, HBAR, RTRI);
  125.     normvideo();
  126.     val = getusrstr(input);
  127.     if (HARDCOPY) {
  128.       fprintf(stdprn, "\n\tPlease enter your menu choice:\n");
  129.       fprintf(stdprn, "\t\t==> %s", input);
  130.     }
  131. #else
  132.     printf("\n\tPlease enter your menu choice:\n");
  133.     printf("\t\t==> ");
  134.     getusrstr(input);
  135. #endif
  136.     if (FILEq && FILECOPY) {
  137.       fprintf(fpout, "\n\tPlease enter your menu choice:\n");
  138.       fprintf(fpout, "\t\t==> %s", input);
  139.     }
  140.  
  141. #if PC
  142.     if (val)
  143.       return(val);
  144.     else {
  145.       clrscr1(3);
  146. #endif
  147.       c = input[0];
  148.       switch (toupper1(c)) {
  149.       case 'A':        /* stay here at general menu */
  150.     break;
  151.       case 'B':        /* goto help menu */
  152.     return(102);
  153.       case 'C':        /* goto animalmenu */
  154.     return(103);
  155.       case 'D':        /* goto cycle length menu */
  156.     return(104);
  157.       case 'E':        /* goto display menu */
  158.     return(114);
  159.       case 'F':        /* goto cell input menu */
  160.     return(105);
  161.       case 'G':        /* goto days input menu */
  162.     return(106);
  163.       case 'H':
  164.     helpoverview();
  165.     break;
  166.       case 'I':
  167.     helpipsyntax();
  168.     break;
  169.       case 'J':
  170.     helpoptable();
  171.     break;
  172.       case 'K':
  173.     helpoptions(opfil);
  174.     break;
  175.       case 'X':        /* Done */
  176.     printexit(30);
  177.       default:
  178. #if PC
  179.     printf("%s%sInvalid choice:  <%c>.\n", tab, ERRSTR, input[0]);
  180.     if (HARDCOPY)
  181.       fprintf(stdprn, "\t%sInvalid choice:  <%c>.", ERRSTR, input[0]);
  182. #else
  183.     printf("\t%sInvalid choice:  <%c>.\n", ERRSTR, input[0]);
  184. #endif
  185.     if (FILEq && FILECOPY)
  186.       fprintf(fpout, "\t%sInvalid choice:  <%c>.\n", ERRSTR, input[0]);
  187.       } /* switch */
  188. #if PC
  189.     } /* if ! val */
  190. #endif
  191.   } /* while */
  192. } /* generalmenu */
  193.  
  194. /********************************/
  195. /*     function: helpmenu    */
  196. /********************************/
  197. /* prints out the help menu, deals with user input to the menu */
  198. helpmenu ()
  199. {
  200.   char input[MAXLEN];    /* user menu choice */
  201.   char c;
  202. #if PC
  203.   int val;        /* return val of getusrstr */
  204.   int i;
  205. #endif
  206.  
  207.   while (TRUE) {
  208. #if PC
  209.     topline(" Help Menu ");
  210.     clrscr1(1);
  211.     normvideo();
  212.     i = 2;
  213.     gotoxy(TAB1, i++);
  214.     cprintf("A:  Go to General Menu");
  215.     gotoxy(TAB1, i++);
  216.     cprintf("B:  (...");
  217.     highvideo();
  218.     cprintf("Help Menu");
  219.     normvideo();
  220.     cprintf("...)");
  221.     gotoxy(TAB1, i++);
  222.     cprintf("C:  Go to Animal Menu");
  223.     gotoxy(TAB1, i++);
  224.     cprintf("D:  Go to Cycle Length Menu");
  225.     gotoxy(TAB1, i++);
  226.     cprintf("E:  Go to Display Menu");
  227.     gotoxy(TAB1, i++);
  228.     cprintf("F:  Go to Cell Input Menu");
  229.     gotoxy(TAB1, i++);
  230.     cprintf("G:  Go to Days Input Menu");
  231.     i = 2;
  232.     gotoxy(TAB2, i++);
  233.     cprintf("H:  Help!: Changing the Cycle Length");
  234.     gotoxy(TAB2, i++);
  235.     cprintf("I:  Help!: Entering Cell Input Data");
  236.     gotoxy(TAB2, i++);
  237.     cprintf("J:  Help!: Entering Days Input Data");
  238.     gotoxy(TAB2, i++);
  239.     cprintf("K:  Help!: Saving Output to a File");
  240.     gotoxy(TAB2, i++);
  241.     cprintf("L:  Help!: Sending Output to a Printer");
  242.     gotoxy(TAB2, i++);
  243.     cprintf("M:  Help!: Using the F1-F10 Keys");
  244.     gotoxy(TAB2, i++);
  245.     cprintf("N:  Help!: Batch Processing Using Stages");
  246.     i++;
  247.     gotoxy(TAB1, i++);
  248.     cprintf("X:  Exit Program");
  249.     if (HARDCOPY) {
  250.       togglepr();
  251.       fprintf(stdprn, "\n\n\t\t    Help Menu\n\n");
  252.       fprintf(stdprn, "\tA:  Go to General Menu\n");
  253.       fprintf(stdprn, "\tB:  (...Help Menu...)\n");
  254.       fprintf(stdprn, "\tC:  Go to Animal Menu\n");
  255.       fprintf(stdprn, "\tD:  Go to Cycle Length Menu\n");
  256.       fprintf(stdprn, "\tE:  Go to Display Menu\n");
  257.       fprintf(stdprn, "\tF:  Go to Cell Input Menu\n");
  258.       fprintf(stdprn, "\tG:  Go to Days Input Menu\n\n");
  259.       fprintf(stdprn, "\tH:  Help!: Changing the Cycle Length\n");
  260.       fprintf(stdprn, "\tI:  Help!: Entering Cell Input Data\n");
  261.       fprintf(stdprn, "\tJ:  Help!: Entering Days Input Data\n");
  262.       fprintf(stdprn, "\tK:  Help!: Saving Output to a File\n");
  263.       fprintf(stdprn, "\tL:  Help!: Sending Output to a Printer\n");
  264.       fprintf(stdprn, "\tM:  Help!: Using the F1-F10 Keys\n");
  265.       fprintf(stdprn, "\tN:  Help!: Batch Processing Using Stages\n\n");
  266.       fprintf(stdprn, "\tX:  Exit Program\n");
  267.     }
  268.     
  269. #else
  270.     printf("\n\n\t\t    Help Menu\n\n");
  271.     printf("\tA:  Go to General Menu\n");
  272.     printf("\tB:  (...Help Menu...)\n");
  273.     printf("\tC:  Go to Animal Menu\n");
  274.     printf("\tD:  Go to Cycle Length Menu\n");
  275.     printf("\tE:  Go to Display Menu\n");
  276.     printf("\tF:  Go to Cell Input Menu\n");
  277.     printf("\tG:  Go to Days Input Menu\n\n");
  278.     printf("\tH:  Help!: Changing the Cycle Length\n");
  279.     printf("\tI:  Help!: Entering Cell Input Data\n");
  280.     printf("\tJ:  Help!: Entering Days Input Data\n");
  281.     printf("\tK:  Help!: Saving Output to a File\n");
  282.     printf("\tL:  Help!: Batch Processing Using Stages\n\n");
  283.     printf("\tX:  Exit Program\n");
  284. #endif
  285.     if (FILEq && FILECOPY) {
  286.       fprintf(fpout, "\n\n\t\t    Help Menu\n\n");
  287.       fprintf(fpout, "\tA:  Go to General Menu\n");
  288.       fprintf(fpout, "\tB:  (...Help Menu...)\n");
  289.       fprintf(fpout, "\tC:  Go to Animal Menu\n");
  290.       fprintf(fpout, "\tD:  Go to Cycle Length Menu\n");
  291.       fprintf(fpout, "\tE:  Go to Display Menu\n");
  292.       fprintf(fpout, "\tF:  Go to Cell Input Menu\n");
  293.       fprintf(fpout, "\tG:  Go to Days Input Menu\n\n");
  294.       fprintf(fpout, "\tH:  Help!: Changing the Cycle Length\n");
  295.       fprintf(fpout, "\tI:  Help!: Entering Cell Input Data\n");
  296.       fprintf(fpout, "\tJ:  Help!: Entering Days Input Data\n");
  297.       fprintf(fpout, "\tK:  Help!: Saving Output to a File\n");
  298.       fprintf(fpout, "\tL:  Help!: Batch Processing Using Stages\n\n");
  299.       fprintf(fpout, "\tX:  Exit Program\n");
  300.     }
  301.  
  302. #if PC
  303.     clrscr1(2);
  304.     cprintf("%sPlease enter your menu choice:", tab);
  305.     gotoxy(1, 2);
  306.     highvideo();
  307.     cprintf("%s%c%c%c ", tab2, HBAR, HBAR, RTRI);
  308.     normvideo();
  309.     val = getusrstr(input); 
  310.     if (HARDCOPY) {
  311.       togglepr();
  312.       fprintf(stdprn, "\n\tPlease enter your menu choice:\n");
  313.       fprintf(stdprn, "\t\t==> %s", input);
  314.     }
  315. #else
  316.     printf("\n\tPlease enter your menu choice:\n");
  317.     printf("\t\t==> ");
  318.     getusrstr(input);
  319. #endif
  320.     if (FILEq && FILECOPY) {
  321.       fprintf(fpout, "\n\tPlease enter your menu choice:\n");
  322.       fprintf(fpout, "\t\t==> %s", input);
  323.     }
  324.  
  325. #if PC
  326.     if (val)
  327.       return(val);
  328.     else {
  329.       clrscr1(3);
  330. #endif
  331.       c = input[0];
  332.       switch (toupper1(c)) {
  333.       case 'A':        /* goto intro menu */
  334.     return(101);
  335.       case 'B':        /* stay here at help menu */
  336.     break;
  337.       case 'C':        /* goto animalmenu */
  338.     return(103);
  339.       case 'D':        /* goto cycle length menu */
  340.     return(104);
  341.       case 'E':        /* goto display menu */
  342.     return(114);
  343.       case 'F':        /* goto cell input menu */
  344.     return(105);
  345.       case 'G':        /* goto days input menu */
  346.     return(106);
  347.       case 'H':
  348.     helpcyclelenip();
  349.     break;
  350.       case 'I':
  351.     helpcellip();
  352.     break;
  353.       case 'J':
  354.     helpdaysip();
  355.     break;
  356.       case 'K':
  357.     helpopfile();
  358.     break;
  359. #if PC
  360.       case 'L':
  361.     helphardcopy();
  362.     break;
  363.       case 'M':
  364.     helpfkeys();
  365.     break;
  366.       case 'N':
  367.     helpbatch();
  368.     break;
  369. #else
  370.       case 'L':        /* batch processing */
  371.     helpbatch();
  372.     break;
  373. #endif
  374.       case 'X':        /* Done */
  375.     printexit(38);
  376.       default:
  377. #if PC
  378.     printf("%s%sInvalid choice:  <%c>.", tab, ERRSTR, input[0]);
  379.     if (HARDCOPY) {
  380.       togglepr();
  381.       fprintf(stdprn, "\t%sInvalid choice:  <%c>.", ERRSTR, input[0]);
  382.     }
  383. #else
  384.     printf("\t%sInvalid choice:  <%c>.", ERRSTR, input[0]);
  385. #endif
  386.     if (FILEq && FILECOPY)
  387.       fprintf(fpout, "\t%sInvalid choice:  <%c>.\n", ERRSTR, input[0]);
  388.       } /* switch */
  389. #if PC
  390.     } /* if ! val */
  391. #endif
  392.   } /* while */
  393. } /* helpmenu */
  394.  
  395. /********************************/
  396. /*     function: animalmenu    */
  397. /********************************/
  398. /* prints out the Animal menu, deals with user input to the menu */
  399. animalmenu (pfpstg, pfpseq, pfpmcl, stgfil, seqfil, mclfil, pnew)
  400.   FILE **pfpstg, **pfpseq, **pfpmcl;
  401.   char *stgfil, *seqfil, *mclfil;
  402.   int *pnew;
  403. {
  404.   char input[MAXLEN];    /* user menu choice */
  405.   char c;
  406.   int valid;        /* boolean */
  407.   int val;
  408. #if PC
  409.   int i;
  410. #endif
  411.  
  412.   valid = 0;
  413.   while (! valid) {
  414. #if PC
  415.     topline(" Animal Menu ");
  416.     clrscr1(1);
  417.     normvideo();
  418.     i = 2;
  419.     gotoxy(TAB2, i++);
  420.     cprintf("H:  Select Sprague-Dawley Rat");
  421.     gotoxy(TAB2, i++);
  422.     cprintf("I:  Select Sherman Rat");
  423.     gotoxy(TAB2, i++);
  424.     cprintf("J:  Select Hamster");
  425.     gotoxy(TAB2, i++);
  426.     cprintf("K:  Select C3H Mouse");
  427.     gotoxy(TAB2, i++);
  428.     cprintf("L:  Select Dog");
  429.     i = 2;
  430.     gotoxy(TAB1, i++);
  431.     cprintf("A:  Go to General Menu");
  432.     gotoxy(TAB1, i++);
  433.     cprintf("B:  Go to Help Menu");
  434.     gotoxy(TAB1, i++);
  435.     cprintf("C:  (...");
  436.     highvideo();
  437.     cprintf("Animal Menu");
  438.     normvideo();
  439.     cprintf("...)");
  440.     gotoxy(TAB1, i++);
  441.     cprintf("D:  Go to Cycle Length Menu");
  442.     gotoxy(TAB1, i++);
  443.     cprintf("E:  Go to Display Menu");
  444.     gotoxy(TAB1, i++);
  445.     cprintf("F:  Go to Cell Input Menu");
  446.     gotoxy(TAB1, i++);
  447.     cprintf("G:  Go to Days Input Menu");
  448.     i++;
  449.     gotoxy(TAB1, i);
  450.     cprintf("X:  Exit Program");
  451.     gotoxy(TAB2, i);
  452.     cprintf("?:  Show Help Screen");
  453.     if (HARDCOPY) {
  454.       togglepr();
  455.       fprintf(stdprn, "\n\n\t\t    Animal Menu\n\n");
  456.       fprintf(stdprn, "\tA:  Go to General Menu\n");
  457.       fprintf(stdprn, "\tB:  Go to Help Menu\n");
  458.       fprintf(stdprn, "\tC:  (...Animal Menu...)\n");
  459.       fprintf(stdprn, "\tD:  Go to Cycle Length Menu\n");
  460.       fprintf(stdprn, "\tE:  Go to Display Menu\n");
  461.       fprintf(stdprn, "\tF:  Go to Cell Input Menu\n");
  462.       fprintf(stdprn, "\tG:  Go to Days Input Menu\n\n");
  463.       fprintf(stdprn, "\tH:  Select Sprague-Dawley Rat\n");
  464.       fprintf(stdprn, "\tI:  Select Sherman Rat\n");
  465.       fprintf(stdprn, "\tJ:  Select Hamster\n");
  466.       fprintf(stdprn, "\tK:  Select C3H Mouse\n");
  467.       fprintf(stdprn, "\tL:  Select Dog\n\n");
  468.       fprintf(stdprn, "\tX:  Exit Program\n");
  469.       fprintf(stdprn, "\t?:  Show Help Screen\n");
  470.     }
  471. #else
  472.     printf("\n\n\t\t    Animal Menu\n\n");
  473.     printf("\tA:  Go to General Menu\n");
  474.     printf("\tB:  Go to Help Menu\n");
  475.     printf("\tC:  (...Animal Menu...)\n");
  476.     printf("\tD:  Go to Cycle Length Menu\n");
  477.     printf("\tE:  Go to Display Menu\n");
  478.     printf("\tF:  Go to Cell Input Menu\n");
  479.     printf("\tG:  Go to Days Input Menu\n\n");
  480.     printf("\tH:  Select Sprague-Dawley Rat\n");
  481.     printf("\tI:  Select Sherman Rat\n");
  482.     printf("\tJ:  Select Hamster\n");
  483.     printf("\tK:  Select C3H Mouse\n");
  484.     printf("\tL:  Select Dog\n\n");
  485.     printf("\tX:  Exit Program\n");
  486.     printf("\t?:  Show Help Screen\n");
  487. #endif
  488.     if (FILEq && FILECOPY) {
  489.       fprintf(fpout, "\n\n\t\t    Animal Menu\n\n");
  490.       fprintf(fpout, "\tA:  Go to General Menu\n");
  491.       fprintf(fpout, "\tB:  Go to Help Menu\n");
  492.       fprintf(fpout, "\tC:  (...Animal Menu...)\n");
  493.       fprintf(fpout, "\tD:  Go to Cycle Length Menu\n");
  494.       fprintf(fpout, "\tE:  Go to Display Menu\n");
  495.       fprintf(fpout, "\tF:  Go to Cell Input Menu\n");
  496.       fprintf(fpout, "\tG:  Go to Days Input Menu\n\n");
  497.       fprintf(fpout, "\tH:  Select Sprague-Dawley Rat\n");
  498.       fprintf(fpout, "\tI:  Select Sherman Rat\n");
  499.       fprintf(fpout, "\tJ:  Select Hamster\n");
  500.       fprintf(fpout, "\tK:  Select C3H Mouse\n");
  501.       fprintf(fpout, "\tL:  Select Dog\n\n");
  502.       fprintf(fpout, "\tX:  Exit Program\n");
  503.       fprintf(fpout, "\t?:  Show Help Screen\n");
  504.     }
  505.     
  506. #if PC
  507.     clrscr1(2);
  508.     cprintf("%sPlease enter your menu choice:", tab);
  509.     gotoxy(1, 2);
  510.     highvideo();
  511.     cprintf("%s%c%c%c ", tab2, HBAR, HBAR, RTRI);
  512.     normvideo();
  513.     val = getusrstr(input);
  514.     if (HARDCOPY) {
  515.       togglepr();
  516.       fprintf(stdprn, "\n\tPlease enter your menu choice:\n");
  517.       fprintf(stdprn, "\t\t==> %s", input);
  518.     }
  519. #else
  520.     printf("\n\tPlease enter your menu choice:\n");
  521.     printf("\t\t==> ");
  522.     getusrstr(input);
  523. #endif
  524.     if (FILEq && FILECOPY) {
  525.       fprintf(fpout, "\n\tPlease enter your menu choice:\n");
  526.       fprintf(fpout, "\t\t==> %s", input);
  527.     }
  528.  
  529. #if PC
  530.     if (val) {
  531.       *pnew = 0;
  532.       return(val);
  533.     } else {
  534. #endif
  535.       c = toupper1(input[0]);
  536.       switch (c) {
  537.       case 'A':        /* goto intro menu */
  538.     return(101);
  539.       case 'B':        /* goto help menu */
  540.     return(102);
  541.       case 'C':        /* stay here at animal menu */
  542.     break;
  543.       case 'D':        /* goto cycle length menu */
  544.     return(104);
  545.       case 'E':        /* goto display meny */
  546.     return(114);
  547.       case 'F':        /* goto cell input menu */
  548.     return(105);
  549.       case 'G':        /* goto days input menu */
  550.     return(106);
  551.       case 'H':    /* sdrat */
  552.       case 'I': /* shrat */
  553.       case 'J': /* hamster */
  554.       case 'K': /* c3h mouse */
  555.       case 'L': /* dog */
  556.     valid = 1;
  557.     val = getanimal(pfpstg, pfpseq, pfpmcl, stgfil, seqfil, mclfil, c);
  558.     if (! val)
  559.       *pnew = 1;
  560. #if (DEBUG > 4)
  561. #if PC
  562.     clrscr1(1);
  563.     gotoxy(1, 5);
  564.     cprintf("%sleaving animalmenu, val = %d", tab, val);
  565.     hitreturn(1);
  566. #else
  567.     printf("\tleaving animalmenu, val = %d\n", val);
  568. #endif
  569. #endif
  570.     return(val);
  571.       case '?':        /* show help screen */
  572.     helpanimalmenu();
  573.     break;
  574.       case 'X':        /* Done */
  575.     printexit(32);
  576.       default:
  577. #if PC
  578.     clrscr1(3);
  579.     printf("%s%sInvalid choice:  <%c>.", tab, ERRSTR, input[0]);
  580.     if (HARDCOPY) {
  581.       togglepr();
  582.       fprintf(stdprn, "\t%sInvalid choice:  <%c>.", ERRSTR, input[0]);
  583.     }
  584. #else
  585.     printf("\t%sInvalid choice:  <%c>.", ERRSTR, input[0]);
  586. #endif
  587.     if (FILEq && FILECOPY)
  588.       fprintf(fpout, "\t%sInvalid choice:  <%c>.\n", ERRSTR, input[0]);
  589.       } /* switch */
  590. #if PC
  591.     } /* if ! val */
  592. #endif
  593.   } /* while */
  594. } /* animalmenu */
  595.